﻿#ifndef BASEINFO_H
#define BASEINFO_H

#include "filemessage.h"
#include "textmessage.h"
#include "spaceblock.h"
#include "fileinfo.h"
#include "timeinfo.h"
#include <QWidget>
#include <QTextEdit>
#include <QFileInfo>
#include <QDebug>

class BaseInfo : public QWidget
{
    Q_OBJECT
public:
    BaseInfo(const QString &msgId,const qint64 &createTime,QWidget *parent = nullptr);
    const QString& getMsgId();
    const qint64& getCreateTime();
protected:
    QString msgId;
    qint64 createTime=0;
    SpaceBlock* block=nullptr;
    //两个之间只能存在一个
    QTextEdit* textEdit=nullptr;
    FileInfo* fileInfo=nullptr;

    TimeInfo* timeInfo=nullptr;
    void removeTextEdit();
    QSize scaleImage(const QString &imagePath);
};

#endif // BASEINFO_H
